package org.iabako.client.config.page;

import org.iabako.client.tools.Messages;

import java.util.Arrays;
import java.util.List;

/**
 * TODO javadoc
 * Date: 24/11/13
 * Time: 18:22
 */
public enum PageConfigEnum implements IPageConfigEnum {

    ClientCreate("client_create_title", "titleclient", "action_create"),
    ClientModify("client_modify_title", "titleclient", "action_modify",
            PageTagItemEnum.ClientInformation,
            PageTagItemEnum.ClientPayment,
            PageTagItemEnum.ClientConversation),

    ProductCreate("product_create_title", "titleproduct", "action_create"),
    ProductModify("product_modify_title", "titleproduct", "action_modify"),

    ServiceCreate("service_create_title", "titleservice", "action_create"),
    ServiceModify("service_modify_title", "titleservice", "action_modify"),

    QuoteMake("quote_make_title", "titlequote", "action_save"),
    QuoteModify("quote_modify_title", "titlequote", "action_save"),

    SaleMake("sale_make_title", "titlesale", "action_sale"),
    SaleModify("sale_modify_title", "titlesale", "action_modify",
            PageTagItemEnum.SaleInformation,
            PageTagItemEnum.SalePayment,
            PageTagItemEnum.SaleInvoice),

    PaymentMake(null, null, null),
    PaymentModify(null, null, null),
    InstallmentMake(null, null, null),
    InstallmentModify(null, null, null),

    ExpenseMake("expense_make_title", "titleexpense", "action_create"),
    ExpenseModify("expense_modify_title", "titleexpense", "action_modify"),


    EnterpriseConfiguration("account_menu_enterprise", "enterprise", "action_save",
            PageTagItemEnum.MyEnterpriseConfigForm,
            PageTagItemEnum.MyEnterpriseCustomInfoForm),

    NotificationConfiguration("notification_settings_title", "notification", "action_save"),
    PaymentRequestConfiguration("payment_request_configuration_title", "paymentrequest", "action_save"),
    PaymentRequestMailModify(null, null, null),
    PaymentRequestPreviewMailContent(null, null, null),

    UserConfiguration("account_menu_users_title", "titleusers", "action_save",
            PageTagItemEnum.MyUser,
            PageTagItemEnum.Users),
    UserForm(null, null, null, null),
    ClientCustomFieldsConfiguration("account_client_custom_fields_configuration", "titleconfiguration", "action_save"),

    CommunicationCreate(null, null, null, null),

    Login(null, null, null, null),
    PasswordReminder(null, null, null, null),
    GoToDemo(null, null, null, null),
    SignUp(null, null, null, null),
    BuyCredit(null, null, null, null),
    AskQuestion(null, null, null, null),
    ReportBug(null, null, null, null),
    Terms(null, null, null, null),
    Privacy(null, null, null, null);

    private String titleKey;
    private String titleIconClass;
    private String buttonLabelKey;
    private List<PageTagItemEnum> pageTagItems;

    private PageConfigEnum(String titleKey, String titleIconClass, String buttonLabelKey, PageTagItemEnum... pageTagItems) {
        this.titleKey = titleKey;
        this.titleIconClass = titleIconClass;
        this.buttonLabelKey = buttonLabelKey;
        this.pageTagItems = pageTagItems != null ? Arrays.asList(pageTagItems) : null;
    }

    public String getTitle() {
        return Messages.getLabel(titleKey);
    }

    public String getTitleIconClass() {
        return titleIconClass;
    }

    public String getButtonLabel() {
        return Messages.getLabel(buttonLabelKey);
    }

    public List<PageTagItemEnum> getPageTagItems() {
        return pageTagItems;
    }
}
